<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateComFilesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('com_files'))
        {
            Schema::create('com_files', function (Blueprint $table) {
                $table->string('id', 45)->primary()->comment('ID');
                $table->string('service_id', 45)->nullable()->comment('记录ID');
                $table->string('place', 45)->nullable()->comment('代码');
                $table->string('path', 200)->nullable()->comment('存储路径');
                $table->string('type', 45)->nullable()->comment('文件类型');
                $table->float('size')->default(0)->nullable()->comment('文件大小');
                $table->integer('sort')->default(0)->nullable()->comment('文件大小');
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('com_files');
    }
}
